using UnityEngine;

public class Shake : MonoBehaviour
{
	private IRageSpline rageSpline;

	public Vector2 shakeSize;

	private void Awake()
	{
		rageSpline = GetComponent(typeof(RageSpline)) as IRageSpline;
	}

	private void Update()
	{
		for (int i = 0; i < rageSpline.GetPointCount(); i++)
		{
			Vector3 position = rageSpline.GetPosition(i);
			Vector3 vector = new Vector3(Random.Range(-0.5f * shakeSize.x, 0.5f * shakeSize.x), Random.Range(-0.5f * shakeSize.y, 0.5f * shakeSize.y), 0f);
			rageSpline.SetPoint(i, position + vector);
		}
		rageSpline.RefreshMesh(true, true, true);
	}
}
